package br.com.cadele.service;

import java.io.Serializable;
import java.util.ArrayList;

import br.com.cadele.dao.AlunoDAO;
import br.com.cadele.model.Aluno;

public class AlunoService implements Serializable {

	private static final long serialVersionUID = 6764194164578704612L;
	private AlunoDAO alunoDAO;
	
	public AlunoService(){
		alunoDAO = new AlunoDAO();
	}
	
	public ArrayList<Aluno> getAll(){
		return alunoDAO.executeQuery("SELECT * FROM Aluno");
	}

	public void executeInsert(Aluno aluno){
		StringBuilder query = new StringBuilder();
		query.append("INSERT INTO Aluno VALUES ('");
		query.append(aluno.getMatricula()+"','");
		query.append(aluno.getCodigoCurso()+"','");
		query.append(aluno.getEmail()+"','");
		query.append(aluno.getNome()+"','");
		query.append(aluno.getCpf()+"','");
		query.append(aluno.getEndereco()+"')");
		alunoDAO.executeSQL(query.toString());
	}
	
	public void executeUpdate(Aluno aluno, long id){
		//TODO
		alunoDAO.executeQuery("");
	}
	
	public void executeDelete(Aluno aluno){
		//TODO
		alunoDAO.executeQuery("");
	}
	
}
